package com.jlpay.openapi.demo.openmerch.device;

import com.jlpay.open.jlpay.sdk.java.model.openmerch.device.request.DeviceCancelRequest;
import com.jlpay.open.jlpay.sdk.java.model.openmerch.device.response.DeviceCancelResponse;
import com.jlpay.open.jlpay.sdk.java.utils.json.JsonUtils;
import com.jlpay.openapi.demo.JlpayOpenApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author dengwenning
 * @since 2024/4/24
 **/
public class CancelService {

    private static final Logger LOGGER = LoggerFactory.getLogger(CancelService.class);

    public static void main(String[] args) {
        DeviceCancelRequest deviceCancelRequest = buildDeviceCancelRequest();
        DeviceCancelResponse deviceCancelResponse = JlpayOpenApiService.openMerchWithCryptoService()
                .post(deviceCancelRequest, DeviceCancelResponse.class);
        LOGGER.info("撤机响应:{}", JsonUtils.toString(deviceCancelResponse));

    }

    private static DeviceCancelRequest buildDeviceCancelRequest(){
        DeviceCancelRequest deviceCancelRequest = new DeviceCancelRequest();

        deviceCancelRequest.setTermNo("S1002514");
        deviceCancelRequest.setMerchNo("NS301257963");

        return deviceCancelRequest;
    }

}
